﻿@model MeetingFormModel
@{
	ViewBag.Title = Resources.MeetingAttendence + ConstValues.strDash + ViewBag.ConferenceName;
}
<div class="rbox fl" style="width:1200px">
	<div id="right">
		<div class="con">
			<div class="formDiv">
				<form id="frmForm" method="post" enctype="multipart/form-data">
					@Html.AntiForgeryToken()
					<span id="ctnForm"></span>
					<input type="hidden" id="hidCurrentPage" name="CurrentPage" />
					<input type="hidden" id="hidConferenceId" name="ConferenceId" />
					<input type="hidden" id="hidCurrency" name="Currency" />
					<input type="hidden" id="hidRegisterIdentity" />
					<input type="hidden" id="hidMail" name="selfMail" />
					<input type="hidden" id="hidIdentityId" />
					<input type="hidden" id="hidIdentityPage" />
					<input type="hidden" id="hidConcurrentEvenPage" />
				</form>
			</div>
			<form id="alipaysubmit" name="alipaysubmit" action="https://www.alipay.com/cooperate/gateway.do?" method="get">
				<input id="hidservice" name="service" type="hidden" />
				<input id="hidpartner" name="partner" type="hidden" />
				<input id="hidseller_id" name="seller_id" type="hidden" />
				<input id="hid_input_charset" name="_input_charset" type="hidden" />
				<input id="hidpayment_type" name="payment_type" type="hidden" />
				<input id="hidnotify_url" name="notify_url" type="hidden" />
				<input id="hidreturn_url" name="return_url" type="hidden" />
				<input id="hidsubject" name="subject" type="hidden" />
				<input id="hidsign_type" name="sign_type" type="hidden" />
				<input id="hidsign" name="sign" type="hidden" />
				<input id="hidout_trade_no" name="out_trade_no" type="hidden" />
				<input id="hidtotal_fee" name="total_fee" type="hidden" />
				<input id="hidbody" name="body" type="hidden" />
				<input type="submit" value="支付宝" style="display:none;">
			</form>
			<form id="epaysubmit" name="epaysubmit" action="https://pay.yizhifubj.com/customer/i18n/i18n_raw_order3_0.jsp" method="get">
				<input id="v_mid" name="v_mid" type="hidden" />
				<input id="v_oid" name="v_oid" type="hidden" />
				<input id="v_rcvname" name="v_rcvname" type="hidden" />
				<input id="v_rcvaddr" name="v_rcvaddr" type="hidden" />
				<input id="v_rcvtel" name="v_rcvtel" type="hidden" />
				<input id="v_rcvpost" name="v_rcvpost" type="hidden" />
				<input id="v_amount" name="v_amount" type="hidden" />
				<input id="v_ymd" name="v_ymd" type="hidden" />
				<input id="v_orderstatus" name="v_orderstatus" type="hidden" />
				<input id="v_ordername" name="v_ordername" type="hidden" />
				<input id="v_url" name="v_url" type="hidden" />
				<input id="v_moneytype" name="v_moneytype" type="hidden" />
				<input id="v_md5info" name="v_md5info" type="hidden" />
				<input id="v_language" name="v_language" type="hidden" />
				<input type="submit" value="支付宝" style="display:none;">
			</form>
		</div>
	</div>
</div>
@section bodyParts {
	<div id="visaWindow" class="easyui-window"
	     title="@Resources.VisaInfo" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	     style="width:1200px; display:none;">
		<div class="main">
			<div class="box clearfix">
				<form id="frmVisa" method="post">
					@Html.AntiForgeryToken()
					<table width="100%" height="100%" id="tblVisa" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
						<tr>
							<td style="text-align: right;" class="w1 c1">First Name：</td>
							<td style="text-align: left;" class="w2 c2">
								<input type="hidden" id="hidVisa" name="VisaId" />
								<input type="hidden" id="hidVisaConferenceId" name="ConferenceId" />
								<input id="v-FirstName" name="FirstName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
							<td style="text-align: right;" class="w1 c1">Last Name：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-FamilyName" name="FamilyName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">Title：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-Title" name="Title" class="easyui-combobox" style="height:27px; width:300px;" />
							</td>
							<td style="text-align: right;" class="w1 c3">Affiliation：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-Affiliation" name="Affiliation" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">Country：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-Country" name="Country" class="easyui-combobox" style="height:27px; width:300px;" />
							</td>
							<td style="text-align: right;" class="w1 c1"></td>
							<td style="text-align: left;" class="w2 c2"></td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">State/Province：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-State" name="State" class="easyui-textbox" style="height:27px; width:300px;" />
							</td>
							<td style="text-align: right;" class="w1 c3"></td>
							<td style="text-align: left;" class="w2 c4"></td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">City：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-City" name="City" class="easyui-textbox" style="height:27px; width:300px;" />
							</td>
							<td style="text-align: right;" class="w1 c1"></td>
							<td style="text-align: left;" class="w2 c2"></td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">Zip/Postal Code：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-ZipCode" name="ZipCode" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
							<td style="text-align: right;" class="w1 c3"></td>
							<td style="text-align: left;" class="w2 c4"></td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">Address：</td>
							<td style="text-align: left;" class="w2 c2" colspan="3">
								<input id="v-Address" name="Address" class="easyui-textbox" style="height:27px; width:884px;" data-options="required:true, validType:['length[1,200]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">Email：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-Mail" name="Mail" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['email','length[1,100]']" />
							</td>
							<td style="text-align: right;" class="w1 c3">Telephone：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-Telephone" name="Telephone" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">Birthdate：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-Birthday" name="Birthdate" class="easyui-datebox" style="height:27px; width:300px;" data-options="editable:false,required:true" />
							</td>
							<td style="text-align: right;" class="w1 c1">Gender：</td>
							<td style="text-align: left;" class="w2 c2">
								<select id="v-Gender" name="Gender" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
									<option value="Male">Male</option>
									<option value="Female">Female</option>
								</select>
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">Passport No：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-PassportNum" name="PassportNum" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
							<td style="text-align: right;" class="w1 c3">Passport Issue Country：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-CountryOfIssue" name="CountryOfIssue" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">Passport Issue Date：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-IssueDate" name="DateOfIssue" class="easyui-datebox" style="height:27px; width:300px;" data-options="editable:false,required:true" />
							</td>
							<td style="text-align: right;" class="w1 c1">Passport Expiry Date：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="v-ExpiryDate" name="ExpiryDate" class="easyui-datebox" style="height:27px; width:300px;" data-options="editable:false,required:true" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">Arrival Date：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-ArrivalDate" name="ArrivalDate" class="easyui-datebox" style="height:27px; width:300px;" data-options="editable:false,required:true" />
							</td>
							<td style="text-align: right;" class="w1 c3">Departural Date：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="v-DeparturalDate" name="DeparturalDate" class="easyui-datebox" style="height:27px; width:300px;" data-options="editable:false,required:true" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c1">Remark：</td>
							<td style="text-align: left;" class="w2 c2" colspan="3">
								<input id="v-Remark" name="Remark" class="easyui-textbox" style="height:50px; width:884px;" data-options="multiline:true, validType:['length[1,1000]']" />
							</td>
						</tr>
					</table>
				</form>
				<div class="btnDiv" id="btnArea">
					<input type="button" class="gbtn" onclick="saveVisa();" value="@Resources.Submit" />&nbsp;&nbsp;
					<input type="button" class="rbtn" onclick="closeVisa();" value="@Resources.Close" />
				</div>
			</div>
		</div>
	</div>
	<div id="otherFeeWindow" class="easyui-window"
	     title="@Resources.Fee" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	     style="width:1200px; display:none;">
		<div class="main">
			<div class="box clearfix">
				<h3 id="detailWindowTitle" class="tit01">@Resources.Create</h3>
				<form id="frmFee" method="post">
					@Html.AntiForgeryToken()
					<table id="otherFeeDG"></table>
					<table width="100%" height="100%" id="tblFee" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
						<tr>
							<td style="text-align: right;" class="w1 c1">@Resources.FeeName：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="ddlFeeName" name="OtherFeeId" class="easyui-combogrid" style="height:27px; width:300px;" data-options="required:true" />
							</td>
							<td style="text-align: right;" class="w1 c1">@Resources.Count：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="ddlCount" name="Count" class="easyui-combobox" style="height:27px; width:300px;" data-options="required:true" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">@Resources.Price：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="txtPrice" class="easyui-textbox" style="height:27px; width:300px;" disabled />
							</td>
							<td style="text-align: right;" class="w1 c3">@Resources.Currency：</td>
							<td style="text-align: left;" class="w2 c4">
								<input id="txtCurrency" class="easyui-textbox" style="height:27px; width:300px;" disabled />
							</td>
						</tr>
					</table>
				</form>
				<div class="btnDiv">
					<input type="button" class="gbtn" onclick="addOtherFee();" value="@Resources.Create" />&nbsp;&nbsp;
					<input type="button" class="rbtn" onclick="closeOtherFee();" value="@Resources.Close" />
				</div>
			</div>
		</div>
	</div>
	<div id="recWindow" class="easyui-window"
	     title="@Resources.RecommendToOthers" data-options="modal:true,closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	     style="width:1200px; display:none;">
		<div class="main">
			<div class="box clearfix">
				<h3 id="recWindowTitle" class="tit01"></h3>
				<form id="recommendationDetail" method="post">
					@Html.AntiForgeryToken()
					<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
						<tr>
							<td style="text-align: right;" class="w1 c1">@Resources.FamilyName：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="rechidConferenceId" name="conferenceId" type="hidden" />
								<input id="recFamilyName" name="recFamilyName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
							<td style="text-align: right;" class="w1 c1">@Resources.FirstName：</td>
							<td style="text-align: left;" class="w2 c2">
								<input id="recFirstName" name="recFirstName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">@Resources.Mail：</td>
							<td style="text-align: left;" class="w2 c4" colspan="3">
								<input id="recMail" name="recMail" class="easyui-textbox" style="height:27px; width:300px;" data-options="validType:['email','length[1,100]'], required:true" />
							</td>
						</tr>
						<tr>
							<td style="text-align: right; " class="w1 c1">@Resources.RecommendContent：</td>
							<td style="text-align: left;" class="w2 c2" colspan="3">
								<input type=hidden id="recRecommendContent" name="recRecommendContent" />
								<div class="grid-container">
									<div class="grid-width-100" style="padding-left:0%;padding-right:0%;width:892px;">
										<textarea id="editorRec" name="editorRec"></textarea>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td style="text-align: right;" class="w1 c3">@Resources.ValidateCode：</td>
							<td style="text-align: left;" class="w2 c4" colspan="3">
								<div class="sr">
									<div class="c">
										<input type="text" id="ValidateCode" name="ValidateCode" style="width:150px;"
											onblur="if (this.value == '') this.value = '@Resources.MsgEnterValidateCode';"
											onclick="if (this.value == '@Resources.MsgEnterValidateCode') this.value = '';" value="@Resources.MsgEnterValidateCode" />
										<a>
											<img id="validateCodeImg" src="@Url.Action(nameof(MeetingAttendenceController.ValidateCode), nameof(MeetingAttendenceController).GetControllerName())"
												width="120" height="35" style="float:right" onclick="this.src = '@Url.Action(nameof(MeetingAttendenceController.ValidateCode), nameof(MeetingAttendenceController).GetControllerName())?'+Math.random()" />
										</a>
									</div>
								</div>
							</td>
						</tr>
					</table>
				</form>
				<div class="btnDiv">
					<input type="button" class="gbtn" onclick="saveRecData();" value="@Resources.Send" />&nbsp;&nbsp;
					<input type="button" class="rbtn" onclick="$('#recWindow').window('close');" value="@Resources.Cancel" />
				</div>
			</div>
		</div>
	</div>
}

@section Scripts {
	<script>
		$(function () {
			@if (Request.Cookies["_culture"] != null) {
			<text>
			if ("@Request.Cookies["_culture"].Value" != "@Model.Language") {
				$("#hidCulture").val("@Model.Language");
				$("#frmCulture").submit();
			}
			</text>
		}

			if ("@Model.Language" == "@ConstValues.Language.Cn") {
				$("#mlogo").html("");
				$("#mlogo").append('<img id="logo" src="../Images/homeImg/logo.jpg" />')
			} else {
				$("#mlogo").html("");
				$("#mlogo").append('<img id="logo" src="../Images/homeImg/enlogo.jpg" />')
			}

			$(this).scrollTop(0);

			$("#hidCurrentPage").val(0);
			$("#hidConferenceId").val("@Model.ConferenceId");
			$("#hidConcurrentEvenPage").val("@Model.ConcurrentEventPage")
			getItems(0);

			$("#visaWindow").window({
				onOpen: function () {
					$(this).scrollTop(0);
				},
				height: 790,
				top: 100
			});

			$("#otherFeeWindow").window({
				onOpen: function () {
					$(this).scrollTop(0);
				},
				top: ($(window).height() - 600) * 0.5
			});

			$("#recWindow").window({
				onOpen: function () {
					$(this).scrollTop(0);
				},
				top: ($(window).height() - 600) * 0.5
			});

			var orgCount = 0;
			$("#v-Gender").combobox("setValue", "");
			$("#v-Title").combobox({
				url: "@Url.Action(nameof(UtilityController.GetTitle), nameof(UtilityController).GetControllerName())"
						+ "?conferenceId=" + $("#hidConferenceId").val(),
				required: true,
				editable: false,
				valueField: "id",
				textField: "name",
				onLoadSuccess: function(data) {
					orgCount = data.length;
				},
				onShowPanel: function () {
					if (orgCount < 10) {
						$(this).combobox("panel").height("auto");
					} else {
						$(this).combobox("panel").height(200);
					}
				}
			});

			$("#v-Country").combobox({
				url: "@Url.Action(nameof(UtilityController.GetCountryEn), nameof(UtilityController).GetControllerName())",
				valueField: "id",
				textField: "name",
				required: true,
			});
		});

		function getItems(page) {
			$("#hidCurrentPage").val(page);
			$("#ctnForm").html("");

			if (page == 0) {
				$("#ctnForm").append("<div id='introduction' style='max-height:calc(100vh - 300px);overflow-y: auto;'></div><br />");
				$("#introduction").append("@Html.Raw(Model.AttendenceNotice.Replace("\"", "'"))");
				$("#introduction").append("<div class='clear'></div><br />");
				setButton();
			} else if (page == @Model.TotalPage + 1) {
				$("#ctnForm").append("<img src='@Url.Action(nameof(UtilityController.ConferenceImg),
					nameof(UtilityController).GetControllerName())" + "/" +"@Model.ConferenceId" + "' style='height:400px; width:1200px;' />");
				$("#ctnForm").append("<div class='clear'></div><br />");

				setButton();
			} else {
				var url = "@Url.Action(nameof(MeetingAttendenceController.GetCurrentPageItem),
					nameof(MeetingAttendenceController).GetControllerName())"
						+ "/" + $("#hidConferenceId").val()
						+ "/" + $("#hidCurrentPage").val()
						+ "?random=" + Math.random();

				$.get(url, null, function (data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						setButton();
					} else {
						for (var index = 0; index < data.data.length; index++) {
							if (data.data[index].key == "Mail") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txtMail' name='Mail' />"
									+ "<div id='yesMail' style='display:none; vertical-align: central; position:relative;'>"
									+ "<img src='../Images/ywc.png' width='16'>"
									+ "</div>"
									+ "<div id='noMail' style='display:none; vertical-align: central; position:relative;'>"
									+ "<img src='../Content/jquery-easyui-1.4.5/themes/icons/no.png'>"
									+ "<span style='color:red;position:relative;top:-3px;'>@Resources.MsgSameMail</span>"
									+ "</div>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtMail").textbox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									validType: "length[0,100]",
									validType: "email",
								});

								if ($("#hidMail").val() != "")
								{
									$("#txtMail").textbox("setValue", $("#hidMail").val());
								}

								$("input",$("#txtMail").next("span")).blur(function(){
									var div1 = document.getElementById("yesMail");
									var div2 = document.getElementById("noMail");

									if ($("#txtMail").val() == "") {
										div1.style.display = "none";
										div2.style.display = "none";
									} else {
										url = "@Url.Action(nameof(MeetingAttendenceController.CheckMail),
										nameof(MeetingAttendenceController).GetControllerName())";
										$.post(url, $("#frmForm").serialize(), function (data, textStatus, jqXHR) {
											if (data.result == "@ConstValues.AjaxFailResult") {
												div1.style.display = "none";
												div2.style.display = "inline-block";
											} else {
												div1.style.display = "inline-block";
												div2.style.display = "none";
											}
										});
									}
								})
							}
							else if (data.data[index].key == "Gender") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtGender' name='Gender' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtGenderClear' onclick='$(\"#txtGender\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtGender").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									valueField: "id",
									textField: "name",
									panelHeight: "auto",
									data: [{ "id": "@ConstValues.Gender.男", "name":"@Resources.Male" },
										{ "id":"@ConstValues.Gender.女", "name":"@Resources.Female" }]
								});
							}
							else if (data.data[index].key == "Title") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtTitle' name='Title' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtTitleClear' onclick='$(\"#txtTitle\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtTitle").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetTitle), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val(),
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Degree") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtDegree' name='Degree' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtDegreeClear' onclick='$(\"#txtDegree\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtDegree").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetDegree), nameof(UtilityController).GetControllerName())",
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Country") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtCountry' name='Country' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtCountryClear' onclick='$(\"#txtCountry\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
									+ "<div class='titleDiv'>@Resources.State：</div>"
									+ "<div class='contentDiv'><input class='easyui-textbox' style='height:27px; width:500px' id='txtState' name='State' /></div>"
									+ "<div class='clear'></div>"
									+ "<div class='titleDiv'>@Resources.City：</div>"
									+ "<div class='contentDiv'><input class='easyui-textbox' style='height:27px; width:500px' id='txtCity' name='City' /></div>"
									+ "<div class='clear'></div>"
								);

								$("#txtCountry").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
								});

								$("#txtState").textbox({ validType: "length[1,100]" });
								$("#txtCity").textbox({ validType: "length[1,100]" });
							}
							else if (data.data[index].key == "AttendenceIdentity") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtAttendenceIdentity' name='AttendenceIdentityId' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtAttendenceIdentityClear' onclick='$(\"#txtAttendenceIdentity\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);
								$("#hidIdentityPage").val(data.data[index].displayPage)
								var orgCount = 0;
								$("#txtAttendenceIdentity").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetAttendenceIdentityType), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val(),
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Attendence") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combogrid' style='height:27px; width:500px' id='txtAttendence' name='AttendenceFeeId' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtAttendenceClear' onclick='$(\"#txtAttendence\").combogrid(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtAttendence").combogrid({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									idField: "id",
									textField: "nameAndPrice",
									url: "@Url.Action(nameof(UtilityController.GetFeeAttendence), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val() + "&currency=" + $("#hidCurrency").val(),
									columns:[[
										{ field: "id", hidden: true },
										{ field: "name", title: "@Resources.AttendenceIdentity", width: 238 },
										{ field: "currency", title: "@Resources.Currency", width: 80 },
										{ field: "price", title: "@Resources.Price", width: 60 },
										{ field: "discount", title: "@Resources.Discount", width: 120 }
									]],
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combogrid("panel").height("auto");
										} else {
											$(this).combogrid("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Page") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combogrid' style='height:27px; width:500px' id='txtPage' name='PageFeeId' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtPageClear' onclick='$(\"#txtPage\").combogrid(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtPage").combogrid({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									idField: "id",
									textField: "nameAndPrice",
									url: "@Url.Action(nameof(UtilityController.GetFeePage), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val() + "&currency=" + $("#hidCurrency").val(),
									columns:[[
										{ field: "id", hidden: true },
										{ field: "name", title: "@Resources.FeeName", width: 358 },
										{ field: "currency", title: "@Resources.Currency", width: 80 },
										{ field: "price", title: "@Resources.Price", width: 60 }
									]],
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combogrid("panel").height("auto");
										} else {
											$(this).combogrid("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Meal") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combogrid' style='height:27px; width:500px' id='txtMeal' name='MealFeeId' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtMealClear' onclick='$(\"#txtMeal\").combogrid(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtMeal").combogrid({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									idField: "id",
									textField: "nameAndPrice",
									url: "@Url.Action(nameof(UtilityController.GetFeeMeal), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val() + "&currency=" + $("#hidCurrency").val(),
									columns:[[
										{ field: "id", hidden: true },
										{ field: "name", title: "@Resources.FeeName", width: 238 },
										{ field: "currency", title: "@Resources.Currency", width: 80 },
										{ field: "price", title: "@Resources.Price", width: 60 },
										{ field: "count", title: "@Resources.EatTotalTimes", width: 120 },
									]],
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combogrid("panel").height("auto");
										} else {
											$(this).combogrid("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Other") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input type='button' class='abtn' onclick='openOtherFee();' value='@Resources.CreateOtherFee' />"
									+ "&nbsp;&nbsp;&nbsp;&nbsp;<input class='easyui-textbox' style='height:27px; width:350px' id='txtOther' disabled />"
									+ "<input type='hidden' id='hidOtherFee' name='OtherFee' /><input type='hidden' id='hidOtherFeeCount' name='OtherFeeCount' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);
								$("#txtOther").textbox({});

								$("#otherFeeDG").datagrid({
									fitColumns: true,
									height: 349,
									nowrap: false,
									striped: true,
									columns: [[
										{
											field: "operate", title: "@Resources.Operate", align: "center", width: 150,
											formatter: function(value, rec, index) {
												var tmp = rec.feeName == null ? "" : rec.feeName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
												var strInfo = "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteOtherFee(\""
													+ index + "\",\"" + tmp + "\")'>@Resources.Delete</a>";
												return strInfo;
											}
										},
										{ field: "otherFeeId", hidden: true },
										{ field: "feeName", title: "@Resources.FeeName", align: "center", width: 150 },
										{ field: "count", title: "@Resources.Count", align: "center", width: 100 },
										{ field: "unitPrice", title: "@Resources.UnitPrice", align: "center", width: 100 },
										{ field: "currency", title: "@Resources.Currency", align: "center", width: 100 },
										{ field: "price", title: "@Resources.Price", align: "center", width: 100 },
										{ field: "nameAndPrice", hidden: true },
									]]
								});
							}
							else if (data.data[index].key == "InvoiceTitle") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtInvoiceTitle' name='InvoiceTitle' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtInvoiceTitle").combobox({
									url: "@Url.Action(nameof(UtilityController.GetInvoiceInfo), nameof(UtilityController).GetControllerName())",
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									valueField: "invoiceTitle",
									textField: "invoiceTitle",
									panelHeight: "auto",
									hasDownArrow: false,
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onChange: function (n,o) {
										$("#txtTaxNum").textbox("setValue", "");
										$("#txtAddressAndTel").textbox("setValue", "");
										$("#txtBank").textbox("setValue", "");
										$("#txtBankAccount").textbox("setValue", "");
									},
									onSelect: function (rec) {
										$("#txtTaxNum").textbox("setValue", rec.taxNum);
										$("#txtAddressAndTel").textbox("setValue", rec.addressAndTel);
										$("#txtBank").textbox("setValue", rec.bank);
										$("#txtBankAccount").textbox("setValue", rec.bankAccount);
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									},
									onHidePanel: function () { }
								});
							}
							else if (data.data[index].key == "TaxNum") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txtTaxNum' name='TaxNum' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtTaxNum").textbox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired
								});
							}
							else if (data.data[index].key == "AddressAndTel") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txtAddressAndTel' name='AddressAndTel' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtAddressAndTel").textbox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired
								});
							}
							else if (data.data[index].key == "Bank") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txtBank' name='Bank' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtBank").textbox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired
								});
							}
							else if (data.data[index].key == "BankAccount") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txtBankAccount' name='BankAccount' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#txtBankAccount").textbox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired
								});
							}
							else if (data.data[index].key == "InvoiceId") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtInvoice' name='InvoiceId' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtInvoiceClear' onclick='$(\"#txtInvoice\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtInvoice").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetInvoiceTitle), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val(),
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									}
								});
							}
							else if (data.data[index].key == "Visa") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input type='button' class='gbtn' onclick='openVisa();' value='@Resources.VisaInfo'>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								$("#btnArea").html("");
								$("#btnArea").append('<input type="button" class="gbtn" onclick="saveVisa();" value="@Resources.Submit" />');
								$("#btnArea").append('&nbsp;&nbsp;');
								$("#btnArea").append('<input type="button" class="rbtn" onclick="closeVisa();" value="@Resources.Cancel" />')
							}
							else if (data.data[index].key == "FavouriteTopic") {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtFavouriteTopic' name='FavouriteTopic' />"
									+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtFavouriteTopicClear' onclick='$(\"#txtFavouriteTopic\").combobox(\"clear\");'>@Resources.Clear</a>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								var orgCount = 0;
								$("#txtFavouriteTopic").combobox({
									prompt: data.data[index].tip,
									required: data.data[index].isRequired,
									editable: false,
									multiple: true,
									valueField: "id",
									textField: "name",
									url: "@Url.Action(nameof(UtilityController.GetTopic), nameof(UtilityController).GetControllerName())"
											+ "?conferenceId=" + $("#hidConferenceId").val(),
									onLoadSuccess: function(data) {
										orgCount = data.length;
									},
									onShowPanel: function () {
										if (orgCount < 10) {
											$(this).combobox("panel").height("auto");
										} else {
											$(this).combobox("panel").height(200);
										}
									},
									onHidePanel: function () { }
								});
							}
							else if (data.data[index].key == "ConcurrentEvent") {
								$("#ctnForm").append("<div class='titleDiv' >" +  data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv' id='concurrentEvent' style='height:100%'>"
									+ " <input type='hidden' id='hidEventIdList' name='hidEventIdList'>"
									+ " <input type='hidden' id='hidCountList' name='hidCountList'>"
									+ "</div>"
									+ "<div class='clear'></div>"
								);
								$('#hidConcurrentEvenPage').val(data.data[index].displayPage)
							}
							else if (data.data[index].key == "PaymentType") {
								if ($("#hidCurrency").val() != "") {
									$("#ctnForm").append(""
										+ "<div>"
										+ "<div id='paymentTable'>"
										+ "<span style='margin-left:200px;font-size:18px;font-weight: 600;line-height: 2;color:#333;'> "+"</span>"
										+ "</div>"
										+ "<div class='concurrentPay1'> <span>@Resources.PaidType：<input class='easyui-combobox' style='height:27px; width:200px' id='txtPaymentType' name='PaymentTypeId' /></span></div>"
										+ "<div class='concurrentPay2'> <span>@Resources.PayOnlineRemark</span></div>"
										+ "</div>"
										+ "<div class='clear'></div>"
									);

									$("#txtPaymentType").combobox({
										prompt: data.data[index].tip,
										required: data.data[index].isRequired,
										editable: false,
										valueField: "id",
										textField: "name",
										url: "@Url.Action(nameof(UtilityController.GetPayType), nameof(UtilityController).GetControllerName())"
												+ "?conferenceId=" + $("#hidConferenceId").val(),
										onLoadSuccess: function(data) {
											orgCount = data.length;
										},
										onShowPanel: function () {
											if (orgCount < 10) {
												$(this).combobox("panel").height("auto");
											} else {
												$(this).combobox("panel").height(200);
											}
										}
									});
									setTimeout(function () {
										url = "@Url.Action(nameof(MeetingAttendenceController.GetPaymentInfoData), nameof(MeetingAttendenceController).GetControllerName())"
												+ "/" + $("#hidConferenceId").val() + "?random=" + Math.random();
										$.get(url, null, function (data, textStatus, jqXHR) {
											if (data.result == "@ConstValues.AjaxSuccessResult") {
												var divText = ""
												var totalPrice = 0;
												var currency = "";
												divText += "<table class='concurrentEvent'>"
												divText += "<thead>"
												divText += "<tr>"
												divText += "<th colspan='4'>@Resources.PaymentDetail</th>"
												divText += "</tr>"
												divText += "</thead>"
												divText += "<tbody>"
												for (var i = 0; i < data.data.length; i++) {
													divText += " <tr  >"
													divText += "    <td>"+data.data[i].number+"</td>"
													divText += "    <td >"+data.data[i].name+"</td>"
													divText += "    <td>"+data.data[i].currency+"</td>"
													divText += "    <td>"+data.data[i].fee+"</td>"
													divText += "</tr>"
													totalPrice = data.data[i].totalPrice
													currency = data.data[i].currency
												}
												divText += " <tr  >"
												divText += "    <td colspan='2' style='text-align:right;width:600px'>@Resources.TotalFee：</td>"
												divText += "    <td style='width:40px;text-align:center;text-indent:0px;'>"+currency+"</td>"
												divText += "    <td style='width:120px;text-align:left;text-indent:5px;'>"+totalPrice+"</td>"
												divText += "</tr>"
												divText += "</tbody>"
												divText += "</table>"

												$("#paymentTable").append(divText)
											}
										});
									}, 1000);
								} else {
									$("#ctnForm").append(""
										+ "<div><img style='height:calc(100vh - 150px); width:1200px;' src='../Images/ConferenceNoPay.jpg' /></div>"
									);
								}
							}
							else if (data.data[index].key == "Recommend") {
							}
							else {
								$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
									+ "<div class='contentDiv'>"
									+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txt" + data.data[index].key + "' name='" + data.data[index].key + "' />"
									+ "</div>"
									+ "<div class='clear'></div>"
								);

								if (data.data[index].key.indexOf("Customize") >= 0) {
									$("#txt" + data.data[index].key).textbox({
										prompt: data.data[index].tip,
										required: data.data[index].isRequired
									});
								} else {
									$("#txt" + data.data[index].key).textbox({
										prompt: data.data[index].tip,
										required: data.data[index].isRequired,
										validType: "length[1,100]"
									});
								}
							}
						}

						if ($("#hidCurrentPage").val() == $('#hidConcurrentEvenPage').val()) {
							if ($("#hidIdentityId").val() != "") {
								tempIdentity = $("#hidIdentityId").val();
							} else {
								tempIdentity = "NoIdentity";
							}

							$.get("@Url.Action(nameof(UtilityController.GetConcurrentEvent), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + $("#hidConferenceId").val()
									+ "&identity=" + tempIdentity
									+ "&currency=" + $("#hidCurrency").val(),
									null, function (data, textStatus, jqXHR) {
								if (data.result == "@ConstValues.AjaxSuccessResult") {
									for (var j = 0; j < data.data.length; j++) {
										if(data.data[j].hasEvent){
											var divText = "";
											divText +="<table style='font-size:16px;margin-bottom:30px;width:600px'>"
											divText +=" <tr>"
											divText += " <td valign='top' rowspan='6' style='width:13px'><input type='checkbox' id='eventCheckBox"+j+"' name='eventCheckBox' onchange='selectEvent(this)' style='margin-top:5px'></td>"
											if (data.data[j].link == null) {
												divText += " <td style='padding-left:30px'> "+data.data[j].eventName+"</td>"
											} else {
												divText += " <td style='padding-left:30px'> <a href='"+data.data[j].link+"' style='color:#1874CD;text-decoration:underline;' target='_blank'>"+data.data[j].eventName+"</a></td>"
											}
											divText += " </tr>"
											divText += " <tr>"
											divText += " <td style='padding-left:30px'>@Resources.Time："+data.data[j].eventTime+"</td>"
											divText += " <input type='hidden' id='eventPrice"+j+"' value='"+data.data[j].price+"'>"
											divText += " <input type='hidden' id='eventCurrency"+j+"' value='"+data.data[j].currency+"'>"
											divText += " <input type='hidden' id='eventId"+j+"' value='"+data.data[j].id+"' name='"+data.data[j].id+"'>"
											divText += " </tr>"
											divText += " <tr>"
											divText += " <td style='padding-left:30px'>@Resources.Place："+data.data[j].eventPlace+"</td>"
											divText += " </tr>"
											if(data.data[j].contact != "" || data.data[j].contactPhone != ""){
												var contactText = data.data[j].contact;
												if(data.data[j].contact != "" && data.data[j].contactPhone != ""){
													contactText += " ,  "
												}
												contactText += data.data[j].contactPhone

												divText += " <tr>"
												divText += " <td style='padding-left:30px'>@Resources.ContactInfomation："+contactText+"</td>"
												divText += " </tr>"
											}

											divText += " <tr>"
											divText += " <td style='padding-left:30px'>@Resources.Fee："+data.data[j].fee +"</td>"
											divText += " </tr>"
											divText += " <tr>"
											divText += " <td style='padding-left:30px'>@Resources.AttandenceCount：<input class='easyui-combobox' style='height:27px; width:60px' id='eventNumber"+j+"' name='eventNumber' /></td>"
											divText += " </tr>"
											divText += " </table>"
											divText += "<div class='clear'></div>"
											$("#concurrentEvent").append(divText);

											$("#eventNumber"+j).combobox({
												editable: false,
												valueField: "id",
												textField: "name",
												data:[{}],
												onLoadSuccess: function(data) {
													orgCount = data.length;
												},
												onShowPanel: function () {
													if (orgCount < 5) {
														$(this).combobox("panel").height("auto");
													} else {
														$(this).combobox("panel").height(200);
													}
												},
												onChange:function(){
													countPrice();
												}
											});
											var comboboxData = [];
											if (data.data[j].number != null) {
												for (var k=1 ; k<=data.data[j].number; k++) {
													var map = {}
													map.id = k;
													map.name = k;
													comboboxData.push(map)
												}
											}
											$("#eventNumber"+j).combobox("loadData", comboboxData)
											$("#eventNumber"+j).combobox("setValue", "")
											$('#eventNumber'+j).combobox('readonly',true);
										}
									}
									$("#concurrentEvent").append("<div style='width:100%; height:50px;font-weight:bold;font-size: 16px;' id='showFeeId'><span>@Resources.TotalFee：</span><span id='eventTotalFee'>0 </span></div>");
								}
							});
						}

						url = "@Url.Action(nameof(MeetingAttendenceController.GetCurrentPageValue),
							nameof(MeetingAttendenceController).GetControllerName())"
								+ "/" + $("#hidConferenceId").val()
								+ "?random=" + Math.random();
						$.get(url, null, function (data, textStatus, jqXHR) {
							if (data.result == "@ConstValues.AjaxSuccessResult") {
								$("#txtMail").textbox("setValue", data.data.mail);
								$("#txtFamilyName").textbox("setValue", data.data.familyName);
								$("#txtFirstName").textbox("setValue", data.data.firstName);
								$("#txtFullName").textbox("setValue", data.data.fullName);
								$("#txtGender").combobox("setValue", data.data.gender ? "@ConstValues.Gender.男" : "@ConstValues.Gender.女");
								$("#txtTitle").combobox("setValue", data.data.title);
								$("#txtDegree").combobox("setValue", data.data.degree);
								$("#txtJob").textbox("setValue", data.data.job);
								$("#txtAffiliation").textbox("setValue", data.data.affiliation);
								$("#txtDepartment").textbox("setValue", data.data.department);
								$("#txtCountry").combobox("setValue", data.data.country);
								$("#txtState").textbox("setValue", data.data.state);
								$("#txtCity").textbox("setValue", data.data.city);
								$("#txtAddress").textbox("setValue", data.data.address);
								$("#txtZipCode").textbox("setValue", data.data.zipCode);
								$("#txtTelephone").textbox("setValue", data.data.telephone);
								$("#txtMobile").textbox("setValue", data.data.mobile);
								$("#txtCardId").textbox("setValue", data.data.cardId);

								$("#txtAttendenceIdentity").combobox("setValue", data.data.attendenceIdentityId);
								$("#txtAttendence").combogrid("setValue", data.data.attendenceFeeId);
								$("#txtPage").combogrid("setValue", data.data.pageFeeId);
								$("#txtMeal").combogrid("setValue", data.data.mealFeeId);
								$("#txtOther").textbox("setValue", data.data.otherFeeName);
								$("#hidOtherFee").val(data.data.otherFeeList);
								$("#hidOtherFeeCount").val(data.data.otherFeeCount);
								$("#txtInvoiceTitle").combobox("setValue", data.data.invoiceTitle);
								$("#txtInvoiceTitle").combobox("setText", data.data.invoiceTitle);
								$("#txtTaxNum").textbox("setValue", data.data.taxNum);
								$("#txtAddressAndTel").textbox("setValue", data.data.addressAndTel);
								$("#txtBank").textbox("setValue", data.data.bank);
								$("#txtBankAccount").textbox("setValue", data.data.bankAccount);
								$("#txtInvoice").combobox("setValue", data.data.invoiceId);
								if (data.data.favouriteTopic != "") {
									$("#txtFavouriteTopic").combobox("setValues", data.data.favouriteTopic);
								}
								$("#txtCustomize1").textbox("setValue", data.data.customize1);
								$("#txtCustomize2").textbox("setValue", data.data.customize2);
								$("#txtCustomize3").textbox("setValue", data.data.customize3);
								$("#txtCustomize4").textbox("setValue", data.data.customize4);
								$("#txtCustomize5").textbox("setValue", data.data.customize5);
								$("#txtCustomize6").textbox("setValue", dt.data.customize6);
								$("#txtCustomize7").textbox("setValue", dt.data.customize7);
								$("#txtCustomize8").textbox("setValue", dt.data.customize8);
								$("#txtCustomize9").textbox("setValue", dt.data.customize9);
								$("#txtCustomize10").textbox("setValue", dt.data.customize10);

								if ($("#hidCurrentPage").val() == $("#hidConcurrentEvenPage").val()) {
									var concurrentEventList = [];
									var concurrentEventCount = [];
									if (data.data.concurrentEventList != null && data.data.concurrentEventList != "") {
										concurrentEventList = data.data.concurrentEventList.split(",");
									}
									if (data.data.concurrentEventCount != null && data.data.concurrentEventCount != "") {
										concurrentEventCount = data.data.concurrentEventCount.split(",");
									}
									setTimeout(function () {
										for (var i = 0; i < concurrentEventList.length; i++) {
											var obj = document.getElementsByName(concurrentEventList[i])[0];
											if (obj != null) {
												var number = obj.id.substr(obj.id.length-1, 1);
												document.getElementById("eventCheckBox"+number).checked =true;
												$("#eventNumber"+number).combobox("select", concurrentEventCount[i]);
												$("#eventNumber"+number).combobox("readonly",false);
											}
										}
									}, 1000);
								}

								$("#txtPaymentType").combobox("setValue", data.data.paymentTypeId);
							}
						});
						setButton();
					}
				});
			}
		}

		function selectEvent(obj) {
			var number = obj.id.substr(obj.id.length-1,1)
			if (obj.checked) {
				$("#eventNumber"+number).combobox("select", 1);
				$("#eventNumber"+number).combobox("readonly",false);
			} else {
				$("#eventNumber"+number).combobox("setValue", "")
				$("#eventNumber"+number).combobox("readonly",true);
			}
		}

		function countPrice() {
			var checkboxList = document.getElementsByName("eventCheckBox")
			var totalPrice = 0;
			var eventIdList = "";
			var countList = "";
			var currency = $("#eventCurrency0").val();
			if (currency == "@ConstValues.Currency.美元") {
				currency = "@Resources.Dollar";
			} else {
				currency = "@Resources.Yuan";
			}
			for(var i=0; i<checkboxList.length; i++){
				var checkbox = checkboxList[i];
				if (checkbox.checked == true) {
					var lastndex = checkboxList[i].id.substr(checkboxList[i].id.length-1, 1);
					var price = parseFloat($("#eventPrice"+lastndex).val());
					var count = parseFloat($("#eventNumber"+lastndex).combobox("getValue"));
					if ($("#eventNumber"+lastndex).combobox("getValue") == "") {
						count = 0;
					}
					var addPrice = price * count;
					totalPrice+=addPrice;
					if (eventIdList == "") {
						eventIdList += $("#eventId"+lastndex).val();
						countList += $("#eventNumber"+lastndex).combobox("getValue");
					} else {
						eventIdList += ","+$("#eventId"+lastndex).val();
						countList += ","+$("#eventNumber"+lastndex).combobox("getValue");
					}
				}
			}
			$("span[id='eventTotalFee']").html(totalPrice+" " +currency);
			$("#hidEventIdList").val(eventIdList);
			$("#hidCountList").val(countList);
		}

		function setButton() {
			var temp = "";
			var page = parseInt($("#hidCurrentPage").val());
			var totalPage = @Model.TotalPage;
			if (page == 0) {
				temp += "<div class='titleDiv'>@Resources.RegisterIdentity：</div>";
				temp += "<div class='contentDiv'><select id='ddlRegisterIdentity' class='easyui-combobox' style='height:27px; width:300px'></select></div>";
				temp += "<div class='clear'></div>";
				temp += "<div id='divCurrency'><div class='titleDiv'>@Resources.Currency：</div>";
				temp += "<div class='contentDiv'><select id='ddlCurrency' name='Currency' class='easyui-combobox' style='height:27px; width:300px'></select></div>";
				temp += "<div class='clear'></div></div>";
				temp += "<br />";

				var url = "@Url.Action(nameof(UtilityController.GetCurrency),
						nameof(UtilityController).GetControllerName())" + "?conferenceId=" + $("#hidConferenceId").val();
				$.get(url, null, function (data, textStatus, jqXHR) {
					if (data.data.length == 0) {
						$("#divCurrency").attr("style","display:none");
					} else {
						$("#divCurrency").attr("style","display:block");
						$("#ddlCurrency").combobox({
							data: data.data,
							required: true,
							editable: false,
							valueField: "currency",
							textField: "currency",
							panelHeight: "auto",
							onLoadSuccess: function(data) {
								if ($("#hidCurrency").val() != "") {
									$("#ddlCurrency").combobox("setValue", $("#hidCurrency").val());
								}
							},
						});
					}

					$("#ddlRegisterIdentity").combobox({
						data: [{
							"id": "@ConstValues.GenericSelectionType.有",
							"text": "@Resources.Self"
						},{
							"id":"@ConstValues.GenericSelectionType.无",
							"text":"@Resources.NotSelf"
						}],
						required: true,
						editable: false,
						textField: "text",
						valueField: "id",
						panelHeight: "auto",
					});

					if ($("#hidRegisterIdentity").val() != null) {
						$("#ddlRegisterIdentity").combobox("setValue", $("#hidRegisterIdentity").val());
					}
				});
			} else {
				var previous = page - 1;
				temp += "<input type='button' id='saveBtn' class='sbtn' onclick='saveTmp(" + previous + ", true, 1);' value='@Resources.Previous' />";
			}

			if (page != totalPage ) {
				var next = page + 1;
				var skipType = "next";
				temp += "&nbsp;&nbsp;<input type='button' class='lbtn' onclick='saveTmp(" + next + ", false, 2);' value='@Resources.Next' />"
			} else {
				if ($("#hidCurrency").val() != "") {
					temp += "&nbsp;&nbsp;<input type='button' class='lbtn' onclick='payOnline();' value='@Resources.PayOnline' />"
				}
				temp += "&nbsp;&nbsp;<input type='button' class='gbtn' onclick='submitData();' value='@Resources.Submit' />"
			}
			$("#ctnForm").append("<div class='clear'></div><div style='padding: 25px 0; text-align: center;'>" + temp + "</div>");
		}

		function saveTmp(page, isLast, skipType) {
			var isValid = $("#frmForm").form("validate");
			if ($("#hidCurrentPage").val() == $("#hidIdentityPage").val()) {
				$("#hidIdentityId").val($("#txtAttendenceIdentity").combobox("getValue"))
			}

			if (isLast) {
				isValid = true;
				$("#frmForm").form("disableValidation");
			}

			if (isValid && document.getElementById("noMail") != null) {
				if (document.getElementById("noMail").style.display == "inline-block") {
					common.showError("@Resources.MsgEditMail");
					isValid = false;
				}
			}

			if (isValid) {
				if($("#txtCheckinDate").length > 0 && $("#txtCheckoutDate").length > 0 &&
					$("#txtCheckinDate").datebox("getValue") != "" && $("#txtCheckoutDate").datebox("getValue") != "") {
					var startDate = Date.parse(new Date($("#txtCheckinDate").datebox("getValue")));
					var endDate = Date.parse(new Date($("#txtCheckoutDate").datebox("getValue")));
					if (startDate > endDate) {
						common.showError("@Resources.MsgHotelCheckinDateError");
						return;
					}
				}

				if ($("#ddlRegisterIdentity").length > 0) {
					$("#hidCurrency").val($("#divCurrency").css("display") != "none" ? $("#ddlCurrency").combobox("getValue") : "");
					//$("#hidCurrency").val($("#divCurrency").css("display") != "none" ? $("#ddlCurrency").combobox("getValue") : "@Html.Raw(ConstValues.Currency.人民币)");
					$("#hidRegisterIdentity").val($("#ddlRegisterIdentity").combobox("getValue"));
					if ($("#ddlRegisterIdentity").combobox("getValue") == "@ConstValues.GenericSelectionType.有") {
						$("#hidMail").val("@((User as ICISPrincipal).Email)");
						$.post("@Url.Action(nameof(MeetingAttendenceController.CheckMail),
							nameof(MeetingAttendenceController).GetControllerName())",
							$("#frmForm").serialize(), function (data, textStatus, jqXHR) {
								if (data.result == "@ConstValues.AjaxFailResult") {
									common.showError("@Resources.MsgRecordExist".replace(/\{0\}/g, "@Resources.Mail"));
									return false;
								} else {
									$.post("@Url.Action(nameof(MeetingAttendenceController.GetUserInfoByMail),
										nameof(MeetingAttendenceController).GetControllerName())",
										$("#frmForm").serialize(), function (data, textStatus, jqXHR) {
											getItems(page);
										}
									);
								}
							}
						);
					} else {
						$("#hidMail").val("");
						var isSelf = $("#hidRegisterIdentity").val();
						$("#frmForm").form({
							iframe: false,
							success: function (data) { }
						});

						$("#frmForm").form("submit", {
							url: "@Url.Action(nameof(MeetingAttendenceController.CreateTmp),
								nameof(MeetingAttendenceController).GetControllerName())" +"?isSelf="+isSelf,
							onSubmit: function (param) {
								param.random = Math.random();
							}
						});

						getItems(page);
					}
				} else if (page.toString() == $('#hidConcurrentEvenPage').val()) {
					$("#frmForm").form({
						iframe: false,
						success: function (data) { }
					});

					$("#frmForm").form("submit", {
						url: "@Url.Action(nameof(MeetingAttendenceController.CreateTmp),
							nameof(MeetingAttendenceController).GetControllerName())"+"?currentPage="+$("#hidCurrentPage").val() ,
						onSubmit: function (param) {
							param.random = Math.random();
						}
					});
					var tempIdentity = ""
					if ($("#hidIdentityId").val() != "") {
						tempIdentity = $("#hidIdentityId").val();
					} else {
						tempIdentity = "NoIdentity"
					}

					$.get("@Url.Action(nameof(UtilityController.GetConcurrentEvent), nameof(UtilityController).GetControllerName())"
							+ "?conferenceId=" + $("#hidConferenceId").val()
							+ "&identity=" + tempIdentity
							+ "&currency=" + $("#hidCurrency").val(),
							null, function (data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxSuccessResult") {
							if(data.data.length > 0){
								getItems(page);
							} else {
								if (skipType == 1) {
									page -= 1;
								} else if (skipType == 2) {
									page += 1;
								}
								getItems(page);
							}
						}
					});
				} else {
					$("#frmForm").form({
						iframe: false,
						success: function (data) { }
					});

					$("#frmForm").form("submit", {
						url: "@Url.Action(nameof(MeetingAttendenceController.CreateTmp),
							nameof(MeetingAttendenceController).GetControllerName())"+"?currentPage="+$("#hidCurrentPage").val() ,
						onSubmit: function (param) {
							param.random = Math.random();
						}
					});
					getItems(page);
				}
			}
		}

		function openVisa() {
			$("#visaWindow").window("open");
		}

		function saveVisa() {
			var isValid = $("#frmVisa").form("validate");

			if (isValid) {
				$.messager.confirm("@Resources.Submit", "@Resources.CfmSave", function (r) {
					if (r) {
						$("#hidVisa").val("New");
						$("#hidVisaConferenceId").val("@Model.ConferenceId");
						$("#visaWindow").window("close");
					}
				})
			}
		};

		function closeVisa(){
			$("#hidVisa").val("");
			$("#v-FamilyName").textbox("setValue", "");
			$("#v-FirstName").textbox("setValue", "");
			$("#v-Title").combobox("setValue", "");
			$("#v-Country").combobox("setValue", "");
			$("#v-State").textbox("setValue", "");
			$("#v-City").textbox("setValue", "");
			$("#v-ZipCode").textbox("setValue", "");
			$("#v-Affiliation").textbox("setValue", "");
			$("#v-Mail").textbox("setValue", "");
			$("#v-Telephone").textbox("setValue", "");
			$("#v-Birthday").datebox("setValue", "");
			$("#v-Gender").textbox("setValue", "");
			$("#v-Address").textbox("setValue", "");
			$("#v-CountryOfIssue").textbox("setValue", "");
			$("#v-PassportNum").textbox("setValue", "");
			$("#v-IssueDate").datebox("setValue", "");
			$("#v-ExpiryDate").datebox("setValue", "");
			$("#v-ArrivalDate").datebox("setValue", "");
			$("#v-DeparturalDate").datebox("setValue", "");
			$("#v-Remark").textbox("setValue", "");

			$("#visaWindow").window("close");
		}

		function visaPreviewClose() {
			$("#visaWindow").window("close");
		}

		function openOtherFee() {
			$("#ddlFeeName").combogrid("setValue", "");
			$("#ddlCount").combobox({});
			$("#txtPrice").textbox("setValue", "");
			$("#txtCurrency").textbox("setValue", "");

			var orgCount = 0;
			$("#ddlFeeName").combogrid({
				required: true,
				editable: false,
				idField: "id",
				textField: "name",
				url: "@Url.Action(nameof(UtilityController.GetFeeOther), nameof(UtilityController).GetControllerName())"
						+ "?conferenceId="+ $("#hidConferenceId").val() + "&currency=" + $("#hidCurrency").val(),
				columns:[[
					{ field: "id", hidden: true },
					{ field: "name", title: "@Resources.FeeName", width: 170 },
					{ field: "currency", title: "@Resources.Currency", width: 100 },
					{ field: "price", title: "@Resources.Price", width: 100 },
					{ field: "minCount", title: "@Resources.MinCount", width: 100 },
					{ field: "maxCount", title: "@Resources.MaxCount", width: 100 },
					{ field: "recommendation", title: "@Resources.Recommendation", width: 200 },
				]],
				onLoadSuccess: function(data) {
					orgCount = data.length;
				},
				onShowPanel: function () {
					if (orgCount < 10) {
						$(this).combogrid("panel").height("auto");
					} else {
						$(this).combogrid("panel").height(200);
					}
				},
				onSelect: function(rowIndex, rowData) {
					$("#txtPrice").textbox("setValue", rowData.price);
					$("#txtCurrency").textbox("setValue", rowData.currency);

					var data = [];
					for (var index = rowData.minCount; index <= rowData.maxCount; index++) {
						data.push({"index": index});
					}

					$("#ddlCount").combobox({
						data:data,
						editable: false,
						required: true,
						valueField: "index",
						textField: "index"
					});
				}
			});

			$("#otherFeeWindow").window("open");
		}

		function addOtherFee() {
			var isValid = $("#frmFee").form("validate");

			if (isValid) {
				var rows = $("#otherFeeDG").datagrid("getRows");
				for (var index = 0; index < rows.length; index++) {
					if ($("#ddlFeeName").combogrid("getValue") == rows[index].otherFeeId) {
						isValid = false;
						break;
					}
				}

				if (!isValid) {
					common.showError("@Resources.MsgFeeTypeIsExist");
				} else {
					$("#otherFeeDG").datagrid("appendRow", {
						otherFeeId: $("#ddlFeeName").combogrid("getValue"),
						feeName: $("#ddlFeeName").combogrid("getText"),
						count: $("#ddlCount").combobox("getValue"),
						unitPrice: $("#txtPrice").textbox("getValue"),
						currency: $("#txtCurrency").textbox("getValue"),
						price: $("#ddlCount").combobox("getValue") * $("#txtPrice").textbox("getValue"),
					});
				}
			}
		}

		function deleteOtherFee(index, feeName) {
			var confirmMessage = "@Resources.CfmDelete";
			confirmMessage = confirmMessage.replace(/\{0\}/g, feeName);
			$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
				if (r) {
					$("#otherFeeDG").datagrid("deleteRow", index);
				}
			});
		}

		function closeOtherFee() {
			var tmp1, tmp2, tmp3;
			var rows = $("#otherFeeDG").datagrid("getRows");
			for (var index = 0; index < rows.length; index++) {
				if (index == 0) {
					tmp1 = rows[index].feeName + " (" +rows[index].currency + " " +rows[index].price.toFixed(2) + ")";
					tmp2 = rows[index].otherFeeId;
					tmp3 = rows[index].count;
				} else {
					tmp1 = tmp1 + ";" + rows[index].feeName + " (" +rows[index].currency + " " +rows[index].price.toFixed(2) + ")";
					tmp2 = tmp2 + ";" + rows[index].otherFeeId;
					tmp3 = tmp3 + ";" + rows[index].count;
				}
			}

			$("#txtOther").textbox("setValue", tmp1);
			$("#hidOtherFee").val(tmp2);
			$("#hidOtherFeeCount").val(tmp3);
			$("#otherFeeWindow").window("close");
		}

		function changeDays() {
			if($("#txtCheckinDate").length > 0 && $("#txtCheckoutDate").length > 0 &&
				$("#txtCheckinDate").datebox("getValue") != "" && $("#txtCheckoutDate").datebox("getValue") != "") {
				var startDate = new Date($("#txtCheckinDate").datebox("getValue"));
				var endDate = new Date($("#txtCheckoutDate").datebox("getValue"));
				var total = (endDate.getTime() - startDate.getTime()) / 1000;
				$("#txtCheckinDaysCount").numberbox("setValue", parseInt(total / (24 * 60 * 60)));
			}
		}

		function submitData() {
			var payType = $("#hidCurrency").val() != "" ? $("#txtPaymentType").combobox("getValue") : "";
			if ($("#hidCurrency").val() != "" && payType == "") {
				common.showError("@Resources.MsgChoosePayType");
				return;
			}

			var loading = layer.load(0,  {
				shade: [0.4,"#fff"]
			});

			var isSelf = $("#hidRegisterIdentity").val();
			$("#hidVisaConferenceId").val("@Model.ConferenceId");
			$.post("@Url.Action(nameof(MeetingAttendenceController.Submit),
				nameof(MeetingAttendenceController).GetControllerName())"
					+ "?isSelf=" + isSelf +"&payType="+payType,
				$("#frmVisa").serialize(),
				function(data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						layer.close(loading);
						common.showError(data.message);
					} else {
						common.showSuccess(data.message, true);
						if ("@Model.CanRecommend" == "True") {
							layer.close(loading);
							recToOthers("");
						} else {
							setTimeout(function () {
								layer.close(loading);
								window.location = "@Url.Action(nameof(ProfileAttendenceInfoController.Index),
									nameof(ProfileAttendenceInfoController).GetControllerName())";
							}, 2000);
						}
					}
				}
			);
		};

		function recToOthers(code) {
			var language = "@((User as ICISPrincipal).Language)";
			if (language == "@ConstValues.Language.Cn") {
				CKEDITOR.config.language = "zh-cn";
			} else {
				CKEDITOR.config.language = "en";
			}

			ckeditor = CKEDITOR.replace("editorRec");
			CKFinder.setupCKEditor(ckeditor,"~/Scripts/ckfinder/")
			$("#recWindowTitle").text("@Resources.RecommendToOthers");
			$("#rechidConferenceId").val("@Model.ConferenceId");
			$("#recFamilyName").textbox("setValue","");
			$("#recFirstName").textbox("setValue","");
			$("#recMail").textbox("setValue","");
			CKEDITOR.instances.editorRec.setData("");

			$("#recWindow").window({
				onClose: function() {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});
					if (code == "" || $("#hidCurrency").val() == "") {
						setTimeout(function () {
							window.location = "@Url.Action(nameof(ProfileAttendenceInfoController.Index),
							nameof(ProfileAttendenceInfoController).GetControllerName())";
						}, 2000);
					} else {
						pay(code);
					}
				},
			});
			$("#recWindow").window("open");
		}

		function saveRecData() {
			var isValid = $("#recommendationDetail").form("validate");

			if (isValid) {
				var validateCode = $("#ValidateCode").val();
				if (validateCode == "") {
					common.showError("@Resources.MsgEnterValidateCode");
					return;
				}

				var loading = layer.load(0,  {
					shade: [0.4,"#fff"]
				});

				$("#recRecommendContent").val(CKEDITOR.instances.editorRec.getData());
				$.post("@Url.Action(nameof(MeetingAttendenceController.RecToOthers),
					nameof(MeetingAttendenceController).GetControllerName())",
					$("#recommendationDetail").serialize(),
					function(data, textStatus, jqXHR) {
						layer.close(loading);
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#recWindow").window("close");
						}
					}
				);
			}
		}

		function payOnline() {
			if ($("#txtPaymentType").combobox("getValue") == "") {
				common.showError("@Resources.MsgChoosePayType");
				return;
			}

			var payType = $("#txtPaymentType").combobox("getText");
			if (payType != "@ConstValues.PayType.AliPay" && payType != "@ConstValues.PayType.支付宝" &&
				payType != "@ConstValues.PayType.PayEase" && payType != "@ConstValues.PayType.易支付") {
				common.showError("@Resources.PayOnlineRemark");
				return;
			}

			var isSelf = $("#hidRegisterIdentity").val();
			$("#hidVisaConferenceId").val("@Model.ConferenceId");
			$.post("@Url.Action(nameof(MeetingAttendenceController.Submit),
				nameof(MeetingAttendenceController).GetControllerName())"
					+ "?isSelf=" + isSelf +"&payType="+$("#txtPaymentType").combobox("getValue"),
				$("#frmVisa").serialize(),
				function(data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						common.showError(data.message);
					} else {
						common.showSuccess(data.message, true);
						if ("@Model.CanRecommend" == "True") {
							recToOthers(data.data);
						} else {
							pay(data.data);
						}
					}
				}
			);
		}

		function pay(attendenceId) {
			var conferenceId = $("#hidConferenceId").val();
			var payCurrency = $("#hidCurrency").val();
			var payType = $("#txtPaymentType").combobox("getText");

			if (payType == "@ConstValues.PayType.AliPay" || payType == "@ConstValues.PayType.支付宝") {
				var url = "@Url.Action(nameof(ProfileAttendenceInfoController.Alipay),
					nameof(ProfileAttendenceInfoController).GetControllerName())"
						+ "?conferenceId=" + conferenceId + "&attendenceId=" + attendenceId;
				$.get(encodeURI(url), null, function (data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						common.showError(data.message);
					} else {
						$("#hidtotal_fee").val(data.data.fee);
						//$("#hidtotal_fee").val("0.01");
						$("#hidservice").val(data.data.service);
						$("#hidpartner").val(data.data.partner);
						$("#hidseller_id").val(data.data.seller_id);
						$("#hid_input_charset").val(data.data.input_charset);
						$("#hidpayment_type").val(data.data.payment_type);
						$("#hidnotify_url").val(data.data.notify_url);
						$("#hidreturn_url").val(data.data.return_url);
						$("#hidsign_type").val(data.data.sign_type);
						$("#hidsign").val(data.data.sign);
						$("#hidsubject").val(data.data.subject);
						$("#hidout_trade_no").val(data.data.out_trade_no);
						$("#hidbody").val(data.data.body);
						document.forms["alipaysubmit"].submit();
					}
				});
			} else if (payType == "@ConstValues.PayType.PayEase" || payType == "@ConstValues.PayType.易支付") {
				var url = "@Url.Action(nameof(ProfileAttendenceInfoController.Epay),
					nameof(ProfileAttendenceInfoController).GetControllerName())"
						+ "?conferenceId=" + conferenceId + "&attendenceId=" + attendenceId;
				$.get(encodeURI(url), null, function (data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						common.showError(data.message);
					} else {
						$("#v_mid").val(data.data.tenantId);//商户编号
						$("#v_oid").val(data.data.v_oid);//订单编号
						$("#v_rcvname").val(data.data.tenantId);//收货人姓名
						$("#v_rcvaddr").val(data.data.tenantAddress);//收货人地址
						$("#v_rcvtel").val(data.data.tenantPhone);//收货人电话
						$("#v_rcvpost").val(data.data.postcode);//编码
						$("#v_amount").val(data.data.fee);//订单金额
						$("#v_ymd").val(data.data.createDate);//订单日期
						$("#v_orderstatus").val("1");//配货状态
						$("#v_ordername").val(data.data.v_ordername);//订货人姓名
						$("#v_moneytype").val(data.data.v_moneytype);//支付币种
						$("#v_url").val(data.data.v_url);//返回地址
						$("#v_md5info").val(data.data.v_md5info);//订单加密
						$("#v_language").val(data.data.v_language);
						document.forms["epaysubmit"].submit();
					}
				});
			}
		}
	</script>
}